package vista;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.event.ActionListener;

import javax.swing.BorderFactory;
import javax.swing.ComboBoxModel;
import javax.swing.DefaultComboBoxModel;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JSeparator;
import javax.swing.JTextField;

import javax.swing.WindowConstants;
import javax.swing.border.BevelBorder;
import javax.swing.SwingUtilities;


/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class FormIngrediente extends javax.swing.JFrame {
	private JPanel Fondo;
	private JSeparator jSeparator1;
	private JPanel Fondo1;
	private JLabel jLabel2;
	private JLabel jLabel3;
	private JLabel jLabel4;
	private JLabel jLabel5;
	private JSeparator jSeparator3;
	private JTextField txtexistencia;
	private JTextField txtstockmax;
	private JTextField txtstockmin;
	private JTextField txtnombre;
	private JButton bntBuscar;
	private JSeparator jSeparator2;
	private JTextField txtcodIng;
	private JLabel jLabel6;
	private JButton bntSalir;
	private JButton bntCancelar;
	private JButton bntEliminar;
	private JButton bntGuardar;
	private JPanel Fondo2;
	private JLabel jLabel1;
	
	public FormIngrediente() {
		super();
		initGUI();
	}
	
	private void initGUI() {
		try {
			setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
			getContentPane().setBackground(Color.white);
			this.setTitle("Formulario de Ingrediente");
			{
				Fondo = new JPanel();
				getContentPane().add(Fondo, BorderLayout.CENTER);
				getContentPane().add(Fondo).setBackground(Color.white);
				Fondo.setPreferredSize(new java.awt.Dimension(465, 406));
				Fondo.setLayout(null);
				{
					jSeparator1 = new JSeparator();
					Fondo.add(jSeparator1);
					jSeparator1.setBounds(63, 58, 341, 11);
				}
				{
					jLabel1 = new JLabel();
					Fondo.add(jLabel1);
					jLabel1.setText("Datos del Ingrediente");
					jLabel1.setBounds(73, 27, 337, 35);
					jLabel1.setFont(new java.awt.Font("Purisa",1,24));
				}
				{
					Fondo1 = new JPanel();
					Fondo.add(Fondo1);
					//Fondo1.setLayout(Fondo1Layout);
					Fondo1.setBounds(38, 80, 389, 226);
					Fondo1.setBorder(BorderFactory.createEtchedBorder(BevelBorder.LOWERED));
					Fondo1.setLayout(null);
					{
						jLabel2 = new JLabel();
						Fondo1.add(jLabel2);
						jLabel2.setText("Cod. Ingrediente");
						jLabel2.setBounds(18, 16, 119, 23);
						jLabel2.setFont(new java.awt.Font("Dialog",0,14));
					}
					{
						jLabel3 = new JLabel();
						Fondo1.add(jLabel3);
						jLabel3.setText("Nombre");
						jLabel3.setBounds(26, 64, 64, 23);
						jLabel3.setFont(new java.awt.Font("Dialog",0,14));
					}
					{
						jLabel4 = new JLabel();
						Fondo1.add(jLabel4);
						jLabel4.setText("Stock Minimo");
						jLabel4.setBounds(26, 102, 95, 23);
						jLabel4.setFont(new java.awt.Font("Dialog",0,14));
					}
					{
						jLabel5 = new JLabel();
						Fondo1.add(jLabel5);
						jLabel5.setText("Stock Maximo");
						jLabel5.setBounds(26, 143, 95, 23);
						jLabel5.setFont(new java.awt.Font("Dialog",0,14));
					}
					{
						jLabel6 = new JLabel();
						Fondo1.add(jLabel6);
						jLabel6.setText("Existencia");
						jLabel6.setBounds(26, 180, 81, 23);
						jLabel6.setFont(new java.awt.Font("Dialog",0,14));
					}
					{
						txtcodIng = new JTextField();
						Fondo1.add(getTxtcodIng());
						txtcodIng.setBounds(146, 15, 143, 23);
					}
					{
						jSeparator2 = new JSeparator();
						Fondo1.add(jSeparator2);
						jSeparator2.setBounds(10, 49, 371, 10);
					}
					{
						bntBuscar = new JButton();
						Fondo1.add(bntBuscar);
						bntBuscar.setText("B");
						bntBuscar.setIcon(new ImageIcon(getClass().getClassLoader().getResource("imagenes/buscar1.png")));
						bntBuscar.setBounds(307, 10, 67, 35);
					}
					{
						txtnombre = new JTextField();
						Fondo1.add(getTxtnombre());
						txtnombre.setBounds(146, 64, 148, 23);
					}
					{
						txtstockmin = new JTextField();
						Fondo1.add(getTxtstockmin());
						txtstockmin.setBounds(146, 102, 148, 23);
					}
					{
						txtstockmax = new JTextField();
						Fondo1.add(getTxtstockmax());
						txtstockmax.setBounds(146, 143, 148, 23);
					}
					{
						txtexistencia = new JTextField();
						Fondo1.add(getTxtexistencia());
						txtexistencia.setBounds(146, 180, 148, 23);
					}
				}
				{
					Fondo2 = new JPanel();
					Fondo.add(Fondo2);
					Fondo2.setBounds(12, 331, 442, 55);
					Fondo2.setBorder(BorderFactory.createEtchedBorder(BevelBorder.LOWERED));
					Fondo2.setLayout(null);
					{
						bntGuardar = new JButton();
						Fondo2.add(bntGuardar);
						bntGuardar.setText("Guardar");
						bntGuardar.setIcon(new ImageIcon(getClass().getClassLoader().getResource("imagenes/aceptar.png")));
						bntGuardar.setFont(new java.awt.Font("Dialog",0,11));
						bntGuardar.setBounds(10, 9, 110, 38);
					}
					{
						bntEliminar = new JButton();
						Fondo2.add(bntEliminar);
						bntEliminar.setText("Eliminar");
						bntEliminar.setIcon(new ImageIcon(getClass().getClassLoader().getResource("imagenes/eliminar1.png")));
						bntEliminar.setFont(new java.awt.Font("Dialog",0,11));
						bntEliminar.setBounds(129, 9, 112, 38);
					}
					{
						bntCancelar = new JButton();
						Fondo2.add(bntCancelar);
						bntCancelar.setText("Cancelar");
						bntCancelar.setIcon(new ImageIcon(getClass().getClassLoader().getResource("imagenes/eliminar.png")));
						bntCancelar.setFont(new java.awt.Font("Dialog",0,11));
						bntCancelar.setBounds(250, 9, 114, 38);
					}
					{
						bntSalir = new JButton();
						Fondo2.add(bntSalir);
						bntSalir.setText("S");
						bntSalir.setIcon(new ImageIcon(getClass().getClassLoader().getResource("imagenes/salir1.png")));
						bntSalir.setBounds(372, 8, 61, 38);
					}
				}
				{
					jSeparator3 = new JSeparator();
					Fondo.add(jSeparator3);
					jSeparator3.setBounds(63, 22, 341, 10);
				}
			}
			pack();
			this.setSize(467, 434);
		} catch (Exception e) {
		    //add your error handling code here
			e.printStackTrace();
		}
	}
	
	public void SettxtcodIng(String str)
	{
		txtcodIng.setText(str);
	}
	public JTextField getTxtcodIng() {
		return txtcodIng;
	}
	
	public void SetTxtNombre(String str)
	{
		txtnombre.setText(str);
	}
	public JTextField getTxtnombre() {
		return txtnombre;
	}
	
	public void SetTxtstockmin(String str)
	{
		txtstockmin.setText(str);
	}
	public JTextField getTxtstockmin() {
		return txtstockmin;
	}
	
	public void SetTxtstockmax(String str)
	{
		txtstockmax.setText(str);
	}
	public JTextField getTxtstockmax() {
		return txtstockmax;
	}
	
	public void SetTxtexistencia(String str)
	{
		txtexistencia.setText(str);
	}
	public JTextField getTxtexistencia() {
		return txtexistencia;
	}
	
	public void addListener(ActionListener actionListener) {
		this.bntBuscar.addActionListener(actionListener);
		this.bntGuardar.addActionListener(actionListener);
		this.bntEliminar.addActionListener(actionListener);
		this.bntCancelar.addActionListener(actionListener);
		this.bntSalir.addActionListener(actionListener);
	}
	
	public void mostrarMensaje(String mensaje) {
		JOptionPane.showMessageDialog(this, mensaje);
	}
	public void EnabledBntEliminar(boolean x)
	{
		bntEliminar.setEnabled(x);
	}
	public void EnabledbntBuscar(boolean x)
	{
		bntBuscar.setEnabled(x);
	}
	public void EnabledbntGuardar(boolean x)
	{
		bntGuardar.setEnabled(x);
	}
	public void EnabledbntCancelar(boolean x)
	{
		bntCancelar.setEnabled(x);
	}
}
